﻿using System.Collections.Generic;

namespace CoreEx.Database.Client
{
    /// <summary>
    /// Represents a class that is capable of providing a list of available connections.
    /// </summary>
    public interface IDbConnectionInfoProvider
    {
        /// <summary>
        /// Returns a list of <see cref="DbConnectionInfo"/> instances that describes the 
        /// connections available to the client.
        /// </summary>
        /// <returns>An <see cref="IEnumerable{T}"/> instance that containing available <see cref="DbConnectionInfo"/> instances.</returns>
        IEnumerable<DbConnectionInfo> GetConnections();

        /// <summary>
        /// Adds a new <see cref="DbConnectionInfo"/> instance.
        /// </summary>
        /// <param name="name">The name of the configured connection</param>
        /// <param name="providerName">The invariant provider name.</param>
        /// <param name="connectionString">The connection string used to connect to the database.</param>
        void AddConnection(string name, string providerName, string connectionString);
    }
}
